/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.ts.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.ts.domain.bo.TrainDocumentRelBO;
import com.xy.biz.ts.domain.query.TrainDocumentRelQuery;
import com.xy.biz.ts.domain.converter.TrainDocumentRelConverter;
import com.xy.biz.ts.manager.TrainDocumentRelManager;
import com.xy.biz.ts.dao.TrainDocumentRelDao;

/**
 *
 *
 * @author wwj
 * @date 2021-4-2
 */
@Service
public class TrainDocumentRelManagerImpl implements TrainDocumentRelManager {

	@Autowired
	private TrainDocumentRelDao trainDocumentRelDao;

	@Override
	public int saveTrainDocumentRel(TrainDocumentRelBO trainDocumentRelBO) {
		return trainDocumentRelDao.saveTrainDocumentRel(TrainDocumentRelConverter.toPO(trainDocumentRelBO));
	}

	@Override
	public int saveAllTrainDocumentRel(Collection<TrainDocumentRelBO> collection) {
		return trainDocumentRelDao.saveAllTrainDocumentRel(TrainDocumentRelConverter.toPO(collection));
	}

	@Override
	public int updateTrainDocumentRel(TrainDocumentRelBO trainDocumentRelBO) {
		return trainDocumentRelDao.updateTrainDocumentRel(TrainDocumentRelConverter.toPO(trainDocumentRelBO));
	}

	@Override
	public int updateTrainDocumentRelReleaseFlag(TrainDocumentRelBO trainDocumentRelBO) {
		return trainDocumentRelDao.updateTrainDocumentRelReleaseFlag(TrainDocumentRelConverter.toPO(trainDocumentRelBO));
	}

	@Override
	public int deleteTrainDocumentRel(Long trainDocumentRelId) {
		return trainDocumentRelDao.deleteTrainDocumentRel(trainDocumentRelId);
	}

	@Override
	public TrainDocumentRelBO getTrainDocumentRel(Long trainDocumentRelId) {
		return TrainDocumentRelConverter.fromPO(trainDocumentRelDao.getTrainDocumentRel(trainDocumentRelId));
	}

	@Override
	public List<TrainDocumentRelBO> listTrainDocumentRelById(Collection<Long> collection) {
		return TrainDocumentRelConverter.fromPO(trainDocumentRelDao.listTrainDocumentRelById(collection));
	}

	@Override
	public List<TrainDocumentRelBO> listTrainDocumentRel(TrainDocumentRelQuery query) {
		return TrainDocumentRelConverter.fromPO(trainDocumentRelDao.listTrainDocumentRel(query));
	}

	@Override
	public int countTrainDocumentRel(TrainDocumentRelQuery query) {
		return trainDocumentRelDao.countTrainDocumentRel(query);
	}

	@Override
	public void deleteTrainDocumentRelByTrainId(Long trainId) {
		trainDocumentRelDao.deleteTrainDocumentRelByTrainId(trainId);
	}

}
